package cn.gx.kevin.domain;

import cn.gx.kevin.common.annotation.*;
import cn.gx.kevin.domain.BaseDomain;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

/**
 * Generate by Kevin's CodeBuilder
 **/
public class User extends BaseDomain {

        private static final long serialVersionUID = 984920818538723782L;

        /**
         *
         */
        @ApiParams("")
        private String id;

        /**
         *机构ID
         */
        @ApiParams("机构ID")
        @Require(langKey = "user_require_orgId")
    private String orgId;

    /**
     *账户
     */
    @ApiParams("账户")
    @Require(langKey = "user_require_name")
    @Uniquely(langKey = "user_uniquely", extField = "")
    @NewOldCompare
    private String userAccount;

    /**
     *密码
     */
    @ApiParams("密码")
    private String userPwd;

    /**
     *用户名
     */
    @ApiParams("用户名")
    @Require(langKey = "user_require_userName")
    private String userName;

    /**
     *状态
     */
    @ApiParams("状态")
    private Integer userStatus;

    /**
     *创建用户ID
     */
    @NotApiParam
    private String createUserId;

    /**
     *创建时间
     */
    @NotApiParam
    private Date createTime;

    /**
     *手机
     */
    @ApiParams("手机")
    private String userPhone;

    /**
     *邮箱
     */
    @ApiParams("邮箱")
    private String userEmail;

    /**
     *用户身份ID
     */
    @ApiParams("用户身份ID")
    private String userId;

    /**
     *用户类别
     */
    @ApiParams("用户类别")
    private Integer userType;

    /**
     *更新时间
     */
    @NotApiParam
    private Date updateTime;

    /**
     *
     */
    public String getId() {
        return id;
    }

    /**
     *
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     *机构ID
     */
    public String getOrgId() {
        return orgId;
    }

    /**
     *机构ID
     */
    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    /**
     *账户
     */
    public String getUserAccount() {
        return userAccount;
    }

    /**
     *账户
     */
    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    /**
     *密码
     */
    public String getUserPwd() {
        return userPwd;
    }

    /**
     *密码
     */
    public void setUserPwd(String userPwd) {
        this.userPwd = userPwd;
    }

    /**
     *用户名
     */
    public String getUserName() {
        return userName;
    }

    /**
     *用户名
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     *状态
     */
    public Integer getUserStatus() {
        return userStatus;
    }

    /**
     *状态
     */
    public void setUserStatus(Integer userStatus) {
        this.userStatus = userStatus;
    }

    /**
     *创建用户ID
     */
    public String getCreateUserId() {
        return createUserId;
    }

    /**
     *创建用户ID
     */
    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    /**
     *创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     *创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     *手机
     */
    public String getUserPhone() {
        return userPhone;
    }

    /**
     *手机
     */
    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    /**
     *邮箱
     */
    public String getUserEmail() {
        return userEmail;
    }

    /**
     *邮箱
     */
    public void setUserEmail(String userEmail) {
        this.userEmail = userEmail;
    }

    /**
     *用户身份ID
     */
    public String getUserId() {
        return userId;
    }

    /**
     *用户身份ID
     */
    public void setUserId(String userId) {
        this.userId = userId;
    }

    /**
     *用户类别
     */
    public Integer getUserType() {
        return userType;
    }

    /**
     *用户类别
     */
    public void setUserType(Integer userType) {
        this.userType = userType;
    }

    /**
     *更新时间
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     *更新时间
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }



    @Override
    public String toString(){
        return "id=[" +getId() +"] orgId=[" +getOrgId() +"] userAccount=[" +getUserAccount() +"] userPwd=[" +getUserPwd() +"] userName=[" +getUserName() +"] userStatus=[" +getUserStatus() +"] createUserId=[" +getCreateUserId() +"] createTime=[" +getCreateTime() +"] userPhone=[" +getUserPhone() +"] userEmail=[" +getUserEmail() +"] userId=[" +getUserId() +"] userType=[" +getUserType() +"] updateTime=[" +getUpdateTime() +"]";
    }

    public String getUserNameForUi() {
        if (StringUtils.isNotEmpty(userName)) {
            return userName;
        }
        return userAccount;
    }
}
